/*
 * Copyright (c) 2025 Industrial Software Feature Database
 */
package com.comac.ins.isfd.service.impl;


import java.util.List;

import org.springframework.stereotype.Service;

import com.anwen.mongo.conditions.query.LambdaQueryChainWrapper;
import com.anwen.mongo.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.comac.ins.isfd.domain.bo.FastenerModelBo;
import com.comac.ins.isfd.domain.bo.query.FastenerModelAllowableValueQueryBo;
import com.comac.ins.isfd.service.IFastenerModelService;
import lombok.extern.slf4j.Slf4j;

/**
 * 紧固件service实现类
 *
 * @author wujialin
 * @date 2025-6-7
 */
@Slf4j
@Service
public class IFastenerModelServiceImpl extends ServiceImpl<FastenerModelBo> implements IFastenerModelService {


    @Override
    public List<FastenerModelBo> queryPageList(FastenerModelAllowableValueQueryBo bo) {
        // 构造查询参数
        LambdaQueryChainWrapper<FastenerModelBo> queryChainWrapper = this.lambdaQuery();
        queryChainWrapper
            .eq(StringUtils.isNotBlank(bo.get_id()), FastenerModelBo::get_id, bo.get_id())
            .like(StringUtils.isNotBlank(bo.getSheetName()), FastenerModelBo::getSheetName, bo.getSheetName())
            .like(StringUtils.isNotBlank(bo.getPlateName()), FastenerModelBo::getPlateName, bo.getPlateName())
            .eq(StringUtils.isNotBlank(bo.getUnit()), FastenerModelBo::getUnit, bo.getUnit())
            .like(StringUtils.isNotBlank(bo.getFastenerGrade()), FastenerModelBo::getFastenerGrade, bo.getFastenerGrade());

        List<FastenerModelBo> fastenerModelBoList = this.list(queryChainWrapper);
        return fastenerModelBoList;
    }
}
